package com.ss.android.account.model;

import android.text.TextUtils;
import com.bytedance.common.utility.Logger;
import com.ss.android.article.browser.R;

public class SharePlatform {
    private static final SharePlatform[] ALL;
    public static final SharePlatform MOBILE;
    public static final SharePlatform QZONE;
    public static final SharePlatform WEIXIN;
    public String mAvatar;
    public long mExpire;
    public long mExpireIn;
    public boolean mLogin;
    public final String mName;
    public String mNickname;
    public long mNotTipExpiredTime;
    public String mPlatformUid;
    public boolean mPublishSelected;
    public boolean mRecommendShowed;
    public boolean mSelected;
    public final int mVerbose;

    static {
        QZONE = new SharePlatform("qzone_sns", R.string.ss_pname_qzone);
        MOBILE = new SharePlatform("mobile", R.string.ss_pname_mobile);
        WEIXIN = new SharePlatform("weixin", R.string.ss_pname_weixin);
        ALL = new SharePlatform[]{SharePlatform.QZONE, SharePlatform.MOBILE, SharePlatform.WEIXIN};
    }

    public SharePlatform(String arg4, int arg5) {
        this.mNotTipExpiredTime = -1;
        this.mName = arg4;
        this.mVerbose = arg5;
        this.mLogin = false;
        this.mSelected = false;
        this.mPublishSelected = false;
        this.mNickname = "";
        this.mAvatar = null;
        this.mRecommendShowed = false;
        this.mPlatformUid = "";
    }

    public static SharePlatform getByName(String arg5) {
        SharePlatform v0;
        SharePlatform[] v2 = SharePlatform.ALL;
        int v3 = v2.length;
        int v1 = 0;
        while(true) {
            if(v1 < v3) {
                v0 = v2[v1];
                if(!TextUtils.equals(v0.mName, ((CharSequence)arg5))) {
                    ++v1;
                    continue;
                }
            }
            else {
                break;
            }

            return v0;
        }

        Logger.w("PlatformItem", "Could not find platform by name " + arg5);
        return null;
    }
}

